package main

import (
	"time"
	"fmt"
)

func main() {
	timer()
}

func timer() {
	var c single

	tick := time.NewTicker(1 * time.Second)

	fmt.Println(tick)

	for {
		select {
		case <-tick.C:
			c.incr()
			fmt.Println(c.value)
		}
	}
}

func (s *single) incr() {
	(*s).value++
}